/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.kiakaku.downloadpage;

import java.io.Serializable;

/*
 *   File Node is created by kiakaku on Mar 2, 2012 1:25:54 PM
 * If you want modify this file please insert information in here 
 * - Last modify in Mar 2, 2012, 1:25:54 PM by kiakaku
 *                  
 *
 * @author kiakaku
 */
public class Node implements Serializable {

    private String url;
    private int depth;
    private int id;

    public Node() {
        url = "http://dantri.com.vn/c111/s111-575657/thu-phi-bao-tri-duong-bo-su-cong-bang-chi-la-tuong-doi.htm";
        depth = -1;
        id = -1;
    }

    public Node(String url, int depth, int id) {
        this.depth = depth;
        this.url = url;
        this.id = id;
    }

    @Override
    public boolean equals(Object otherNode) {
        Node node = new Node("", -1, -1);
        node = (Node) otherNode;
        return this.url.equalsIgnoreCase(node.getUrl());
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 97 * hash + (this.url != null ? this.url.hashCode() : 0);
        return hash;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getDepth() {
        return depth;
    }

    public void setDepth(int depth) {
        this.depth = depth;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return url;
    }
}
